package qujian;

import java.util.Arrays;

/**
 * 判断是否重叠
 * intervals = [[1,3],[3,6],[8,10],[15,18]]
 *
 * @author luolidong
 * @version 1.0
 * @create 2021-08-03 14:34
 */
public class L252 {
    public boolean judge(int[][] intervals) {
        Arrays.sort(intervals,(x,y)->x[0]-y[0]);

        for(int i=0;i<intervals.length-1;i++){
            if(intervals[i][1]>intervals[i+1][0]){
                return false;
            }
        }
        return true;
    }
}
